{literal}
<script type="text/javascript">

var provinciasData="{/literal}<?php print getProvincias(); ?>{literal}";
var provinciasElija = "<option value=''> --- {/literal}{$smarty.const.EF_USR_PROVINCIA}{literal} --- </option>";
jQuery(document).ready(function(){
	jQuery("#pais").change(function(){		
		if($("#pais").val()!={/literal}{$smarty.const.ID_PAIS}{literal}){
			jQuery("#provincias").html(provinciasElija);
		}else{
			jQuery("#provincias").html(provinciasElija + provinciasData);
		}	
	 });
});

</script>
{/literal}

<div class="containertable">

<table class="box" border="0">
<tr><th>{$smarty.const.REGISTER}</th></tr>

<tr><td>
{if $show_regform}

<h2>{$smarty.const.REGISTER}</h2>

{if $errorMsg}
	<ol class="red">{$errorMsg}</ol>
{else}
	{$smarty.const.LA_WHY}  
{/if}


<form method="post" action="register.php" name="itemForm" id="itemForm">
<table width="100%" cellspacing="3" cellpadding="3">

<tr style="margin:0px;padding:0px 0px">
     <td style="margin:0px;padding:0px 0px"> {$smarty.const.LA_MAILADDRESS}:</td>
     <td valign="top" class="star">
     <input type="text" name="email" id="email" class="txt" size="30" maxlength="100" 
		value="{if $email}{$email}{/if}" /> *</td>
</tr>

<tr>
     <td> {$smarty.const.LA_FULLNAME}:</td>
     <td valign="top" class="star">
     <input type="text" name="name" class="txt" size="30" maxlength="100" value="{if $name}{$name}{/if}" /> *
     </td>
</tr>

<tr>
     <td> {$la_pass}:</td>
     <td valign="top" class="star">
     <input type="password" name="passwd" class="txt" size="16" 
		maxlength="16" value="{if $passwd}{$passwd}{/if}" /> *</td>
</tr>
<tr>
     <td> {$smarty.const.LA_PASS2}:</td>
     <td valign="top" class="star">
     <input type="password" class="txt" name="passwd2" size="16" 
		maxlength="16" value="{if $passwd2}{$passwd2}{/if}" /> *</td>
</tr>
     
{if $image_validation}
<tr>
     <td> {$smarty.const.LA_IMG_VER}:</td>
     <td valign="top" class="star"><img src="val_img.php" alt="" /></td>
</tr>
    
<tr>
	<td> {$smarty.const.LA_IMG_VER2}:</td>
     <td valign="top" class="star">
     <input type="text" class="txt" name="validate_sign" size="16" maxlength="16" /> *</td>
</tr>
   {/if}


{foreach item=e from=$extra_fields_array}

{if $e.q_catdescr}
	<tr><td colspan="2">
   		<b>{$e.q_catdescr}</b><hr style="color:black;" width="100%" align="left">
	</td></tr>
{/if}

<tr>
	<td valign="top">{$e.q_question} </td>
   	<td valign="top">
   	
   	{if $e.q_type=="t"}

		{if $e.q_question==$smarty.const.EF_USR_PROVINCIA}
		<select name="e_{$e.q_field}" id="provincias">
						<option value=""> --- {$smarty.const.EF_USR_PROVINCIA} --- </option>
						<?php print getProvincias(); ?>
		</select>
		{else}		
   		<input type="text" name="e_{$e.q_field}" size="1" class="{$e.q_css_class}" value="{$e.q_value}" />
   		{/if}
   		
   	{elseif $e.q_type=="p"}

   		<input type="text" name="e_{$e.q_field}" size="7" class="{$e.q_css_class}" value="{$e.q_value}" /> {$set_currency_text}
   	
   	
   	{elseif $e.q_type=="d"}

   		<textarea cols="{$e.q_size}" rows="{$e.q_size_2}" class="{$e.q_css_class}" name="e_{$e.q_field}">{$e.q_value}</textarea>
   		
   	{elseif $e.q_type=="c"}
   		{foreach item=opt from=$e.options}
   		<input type="checkbox" name="e_{$e.q_field}[]" id="{$e.q_field}" value="{$opt.value}" {if $opt.selected_value} checked{/if}>
   			{$opt.text} <br />
   		{/foreach}

   	{elseif $e.q_type=="s"}
   		
   		{if $e.q_question==$smarty.const.EF_USR_PAIS}   			
   		<select name="e_{$e.q_field}" id="pais" class="txt">
		{else}			
		<select name="e_{$e.q_field}" id="e_{$e.q_field}" class="txt">
   		{/if}   		
   		{*<option value='0'>{$smarty.const.LA_EMPTY}</option>*}
   		{foreach item=opt from=$e.options}
   			<option value="{$opt.value}" {if $opt.selected_value} selected{/if}>{$opt.text|escape}</option>
   		{/foreach}
   		</select>
   		
   	{elseif $e.q_type=="r"}
   		
   		{foreach item=opt from=$e.options}
   			<input type="radio" name="e_{$e.q_field}[]" id="{$e.q_field}" value="{$opt.value}" {if $opt.checked} checked{/if}>
   			{$opt.text} <br />
   		{/foreach}
   		
   		
   	{/if}
   	
	{if $e.q_mand}<span class="red">*</span>{/if}
   	
   </td>
</tr>

{/foreach}    
   
<tr>
  <td valign="top">{$smarty.const.LA_NE}:</td>
  <td>
  <input type="checkbox" name="emelding" value="1" {if $emelding} checked {/if} /> {$smarty.const.LA_NO_EMAIL_PLEASE}<br />
  <input type="checkbox" name="hide_email" value="1"{if $hide_email} checked {/if} /> {$smarty.const.LA_HIDE_EMAIL}.
 {if $set_agree_conditions}
 <br />
 <input type="checkbox" name="agree_cond" value="1"{if $agree_cond} checked {/if} /> {$LA_CONDITIONS_TEXT}
 {/if}
 </td>
</tr>
<tr>
     <td colspan="2" align="left">
     <p><input type="submit" class="button" name="submit" value="{$smarty.const.LA_REG}" /></p></td>
</tr>
</table>
 </form>
 <br/>
 <table class="box" border="0">
 <tr>
     <td colspan="2" align="left">
     	{$smarty.const.EF_CAMPOS_OBLIGATORIOS}
     </td>
</tr>
 </table>
 
 <br/>
 <table class="box" border="0">
<tr>
     <td colspan="2" align="left">
     {$smarty.const.EF_CUENTAS}
     </td>
</tr>
 </table>
 
{/if}



{if $registration_ok} 
<h2 class="intend">{$smarty.const.LA_SUCCESSREG}</h2>
<p class="intend">
	{if $verify}
		{$smarty.const.LA_CONFIRM_EMAIL}
	{elseif $wait_approval}
		{$smarty.const.LA_WAIT_APP}
	{else}
		<p class="intend"><a href="member.php">{$smarty.const.LA_SUCCESSREG3}</a></p>
	{/if}
</p>
{/if}

</td></tr></table>

{literal}
<script language="javascript" type="text/javascript">
<!--
content=document.getElementById("email");
if( content != null ){content.focus();}
//-->
</script>
{/literal}
</div>